<nav class="pagination-wrap">
    <ul class="pagination">
        {% if paginator.previous_page %}
        <li>
            <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
            </a>
        </li>
        {% endif %}

        {% for page in (1..paginator.total_pages) %}
            {% if page == paginator.page %}
            <li class="active">
                <a href="#">{{ page }}</a>
            </li>
            {% elsif page == 1 %}
            <li>
                <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
            </li>
            {% else %}
            <li>
                <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
            </li>
            {% endif %}
        {% endfor %}

        {% if paginator.next_page %}
        <li>
            <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
            </a>
        </li>
        {% endif %}
    </ul>
</nav>